double-tree sort

for large data sets (1B records etc)



1.

write the records out, inserting into a binary tree with a random left-right decision at each node



format


each record in the output file

	sort key, data record id, left child record number, right child record number



2.

read the records as an inorder traversal, i.e. process left subtree, output current record, process right subtree,

output to a standard binary tree (record format as above)



3.

read and output the records of the second new file as an inorder traversal, i.e. process left subtree, output current record, 

	process right subtree



total writes = 2 x rec_count

total reads = 2 x log2(rec_count) x rec_count
